<template>
  <div>
    <h2 class="title">Demo</h2>
    <div class="container">
      <div class="container-inner">
        <div :key="index" v-for="(route,index) in routeList">
          <div @click="onItemClick(route)">{{route.name}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>

  .title {
    text-align: center;
  }

  .container {
    padding: 10px;
    background-color: #7f7f7f;
    height: 100vh;
  }

  .container-inner {
    height: 100%;
  }

  .container-inner > div {
    float: left;
    background-color: white;
    height: 30px;
    text-align: center;
    font-size: 24px;
    margin: 4px;
    width: calc(50% - 8px);
  }
</style>

<script>
  import routeList from './route';

  export default {
    data(){
      return {
        routeList: routeList
      }
    },
    methods: {
      onItemClick(route){
        this.$router.push(route.path)

      }
    }
  }
</script>
